package com.midou.administration.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.midou.administration.bo.MemBerBo;
import com.midou.administration.entity.Member;
import com.midou.administration.mapper.MemberMapper;
import com.midou.administration.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;

    //查询会员充值信息
    public Page selectMemberChongZhi(MemBerBo memBerBo){
        List<Member> memberList=memberMapper.selectMemberChongZhi(memBerBo.getPage(),memBerBo.getUserId());
        memBerBo.getPage().setRecords(memberList);
        return memBerBo.getPage();
    }
    //查询会员消费信息
    public Page selectMemberXiaoFei(MemBerBo memBerBo){
        List<Member> memberList=memberMapper.selectMemberXiaoFei(memBerBo.getPage(),memBerBo.getUserId());
        memBerBo.getPage().setRecords(memberList);
        return memBerBo.getPage();
    }

}
